/*
 * class that defines
 */
package iv1201.view;

/**
 *
 * @author anorber
 */
public class Item 
{

    private final String area;
    private final int year;

    /*
     * Constructor. Passes area experience together with correspoding 
     * years of experience to an array in userManager, to be updated in 
     * apply_xp.xhtml
     */    
    Item(String area, int year) 
    {
        this.area = area;
        this.year = year;
    }

    public int getYear() 
    {
        return year;
    }

    public String getArea() 
    {
        return area;
    }

    @Override
    public boolean equals(Object other) 
    {
        if (other instanceof Item)
            return false;
        
        return ((Item)other).area.equals(this.area);
    }

    @Override
    public int hashCode() 
    {
        return (this.area != null ? this.area.hashCode() : 0);
    }
}
